package com.gdkj.enums;

public enum DiggingUserShareType {
    // 分享类型 1 私信 2动态 3微信好友 4朋友圈 5 qq好友 6 qq空间 7 系统分享
    SX(1, "私信"),
    DT(2, "动态"),
    WX(3, "微信好友"),
    PYQ(4, "朋友圈"),
    QQ(5, "qq好友"),
    QQKJ(6, "qq空间"),
    XT(7, "系统分享");

    private Integer type;

    private String name;

    DiggingUserShareType(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer state) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据type获取name值
     * @author chenyanqian
     * @date 2022/11/2
     * @param type : code
     * @return : java.lang.String
     */
    public static String getNameByType(Integer type){
        DiggingUserShareType[] enums = DiggingUserShareType.values();
        for (DiggingUserShareType shareType : enums){
            if(shareType.type.equals(type)){
                return shareType.name;
            }
        }
        return null;
    }
}
